<template>
	<view>
		<!-- 课程内容 -->
		<view style="display: flex;width: 90%;margin: 10rpx auto;justify-content: space-between;flex-wrap: wrap;">
			<view @click="hexiao(item)"  v-for="item in kechenglist" :key="item._id" style="display: flex;width: 90%;background-color: white;border-radius: 15rpx;box-shadow: 1px 1px 5px #c2c2c2;padding: 20rpx;flex-direction: row; justify-content: space-around;align-items: center; margin: 20rpx auto 10rpx auto;">
				<view style="display: flex;flex-direction: column;">
					<view style="font-size: 30rpx;">
						{{item.name}}
					</view>
					<view style="font-size: 26rpx;color: darkgray;margin-top: 15rpx;">
						{{item.xiaoqu}}
					</view>
				</view>
				<view >
					>>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				kechenglist:{},
				item:{},
				meiyi_userinfo:{}
			}
		},
		async onLoad() {
			this.meiyi_userinfo=await uniCloud.getCurrentUserInfo()
			this.mykecheng_fun()
		},
		methods: {
			hexiao(e){
				uni.setStorageSync('aoyashengkecheng1',e)
				uni.navigateTo({
					url: '/pages/kechenghexiao/kechenghexiao'
				});
			},
			mykecheng_fun(){
				uniCloud.callFunction({
					name:"funshare",
					data:{
						leixing:2,//类型为2时，获取我教学的课程
						id:this.meiyi_userinfo.uid,
					}
				}).then(res=>{
					this.kechenglist=res.result.data
				})
			},
		}
	}
</script>

<style>
page{
	background-color: #f8f8f8;
}
</style>
